#include<bits/stdc++.h>

using namespace std;

struct node
{
	int pos;
	int direction=1;
};

std::vector<node> a;
int n,L,t;

void solve(){
	int cnt=0;
	while(cnt<t){
		for (int i = 0; i < n; ++i)
		{
			a[i].pos+=a[i].direction;
			if(a[i].pos == 0 || a[i].pos == L){
				a[i].direction*=-1;
			}
		}
		std::vector<int> v[L+1];
		for (int i = 0; i < n; ++i)
		{
			v[a[i].pos].push_back(i);
		}
		for (int i = 1; i < L; ++i)
		{
			if(v[i].size()>1){
				for (int j = 0; j < v[i].size(); ++j)
				{
					a[v[i][j]].direction*=-1;
				}
			}
		}
		++cnt;
	}
}

int main(){
	scanf("%d%d%d", &n,&L,&t);
	a.resize(n);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &a[i].pos);
	}
	solve();
	for (int i = 0; i < n; ++i)
	{
		printf("%d%c", a[i].pos,i==n-1?'\n':' ');
	}
	return 0;
}